﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dm.Domain.Entities;
//using MySql.Data.MySqlClient;
using Dm.Domain.CrossCutting;

namespace Dm.Domain.Repository.EntityRepositories.ActiveRecord.Objects
{
    public class StudentActiveRecord : IStudentRepository
    {
      
        public StudentActiveRecord()
        {
           
        }

        public List<Student> RetrieveAll(bool includeInactive)
        {
            //MySqlConnection mysqlConnection = new MySqlConnection("Data Source=localhost;Database=ARPAMIS;Uid=root;Pwd=DarkMASTERJAY14;");
            //using (mysqlConnection)
            //{
            //    mysqlConnection.Open();
            //    string query = string.Format("SELECT * FROM Students WHERE StatusId = {0}", Settings.Statuses.ActiveStatus);
            //    MySqlCommand command = new MySqlCommand(query,mysqlConnection);
                List<Student> students = new List<Student>();
            //    MySqlDataReader rd = command.ExecuteReader();
            //    while (rd.Read())
            //    {
            //        Student student = new Student();
            //        student.FirstName = rd["FirstName"].ToString() ?? "";
            //        student.MiddleName = rd["MiddleName"].ToString() ?? "";
            //        student.LastName = rd["LastName"].ToString() ?? "";
            //        student.ControlNumber = rd["StudentNumber"].ToString() ?? "";
            //        student.ContactNumber = rd["ContactNumber"].ToString() ?? "";
            //        student.Email = rd["Email"].ToString() ?? "";
            //        student.EntityId = int.Parse(rd["StudentId"].ToString());
            //        student.AddressId = int.Parse(rd["AddressId"].ToString());
            //        student.YearLevel = int.Parse(rd["YearLevel"].ToString());
                    
            //        students.Add(student);
            //    }

            //    mysqlConnection.Close();
                return students;
                
            //}
        }

        public List<Student> SearchAllParameter(string firstName, string middleName, string lastName, string studentNumber, string email, string contactNumber, string address)
        {
            throw new NotImplementedException();
        }

        public List<Student> SearchByName(string firstName, string middleName, string lastName)
        {
            throw new NotImplementedException();
        }

        public Student Retrieve(int id)
        {
            throw new NotImplementedException();
        }

        public List<Student> Retrieve()
        {
            throw new NotImplementedException();
        }

        public Student Create(Student entity)
        {
            throw new NotImplementedException();
        }

        public void Update(Student entity)
        {
            throw new NotImplementedException();
        }

        public void Delete(Student entity)
        {
            throw new NotImplementedException();
        }

        public void Delete(int id)
        {
            throw new NotImplementedException();
        }
    }
}
